<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="icon" type="text/css" href="__PUBLIC__/Home/icon.ico"/>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Home/css/index.css"/>
    <script src="__PUBLIC__/Home/js/jquery-1.10.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="__PUBLIC__/Home/js/list.js" type="text/javascript" charset="utf-8"></script>
    <script src="__PUBLIC__/layer/layer.js"></script>
</head>

<body>
<!--头部开始-->
<div id="top">
    <!--头部灰条就开始-->
    <div class="topbox">
        <div class="main">
            <div class="topleft fl">
                <a href="javascript:;">欢迎来到冰雨商城</a>
                <a href="#">设为首页</a>
                <a href="#">收藏本站</a>
                <a href="#">帮助中心</a>
                <a href="#" class='last'><i></i>手机商城</a>
            </div>
            <div class="topright fr">
                <div class="login fl">
                    <a href="#">登录</a>
                    <a href="#">注册</a>
                </div>
                <span class="fl">|</span>
                <div class="fcode fl">

                    <a href="">我的订单</a>
                </div>
            </div>
        </div>
    </div>
    <!--头部灰条结束-->

    <!--logo区域开始-->
    <div class="logoRegion main">
        <div class="logo">
            <a href=""><img src="images/360logo.png" alt=""/></a>
        </div>
        <div class="seachRegion fr">
            <div class="seach fl">
                <form action="" method="post">
                    <input type="text" class="seachtxt fl" value="O2+车载空气净化"/>
                    <input type="submit" class="btn" value=""/>
                </form>
                <p class="searchkey">
                    <a href="">电竞配件低至5折</a>
                    <a href="">电竞配件低至5折</a>
                    <a href="">电竞配件低至5折</a>
                </p>

            </div>
            <div class="topshopcart fr">
                <a href="" class="header-cart"><i></i>我的购物车<span class="cart-size">(0)</span></a>
                <div class="cart-tips">
                    请
                    <a href="">登录</a>后查看您的购物车。
                </div>
            </div>
        </div>

    </div>
    <!--logo区域结束-->
    <div class="clear"></div>
    <!--导航开始-->
    <div class="navbox">
        <div class="main">
            <h5 class="fl"><a href=""><i></i>全部智能酷品</a></h5>
            <ul class="menu fl">
                <li class="menulist">
                    <a href="">手机</a>
                    <div class="menuHiden">

                        <ul class="product">

                            <li>
                                <a href=""><img src="images/right.png" alt=""/></li>
                            <li><img src="images/right.png" alt=""/></a>
                            </li>
                            <li>
                                <a href=""><img src="images/right.png" alt=""/></li>
                            <li><img src="images/right.png" alt=""/></a>
                            </li>
                            <li>
                                <a href=""><img src="images/right.png" alt=""/></li>
                            <li><img src="images/right.png" alt=""/></a>
                            </li>

                        </ul>

                    </div>
                </li>
                <li class="menulist">
                    <a href="">行车记录仪</a>
                    <div class="menuHiden">
                        <ul class="product">

                            <li>
                                <a href=""><img src="images/right.png" alt=""/></li>
                            <li><img src="images/right.png" alt=""/></a>
                            </li>
                            <li>
                                <a href=""><img src="images/right.png" alt=""/></li>
                            <li><img src="images/right.png" alt=""/></a>
                            </li>
                            <li>
                                <a href=""><img src="images/right.png" alt=""/></li>
                            <li><img src="images/right.png" alt=""/></a>
                            </li>

                        </ul>
                    </div>
                </li>
                <li class="menulist">
                    <a href="">儿童手表</a>
                    <div class="menuHiden">
                        <ul class="product">

                            <li>
                                <a href=""><img src="images/right.png" alt=""/></li>
                            <li><img src="images/right.png" alt=""/></a>
                            </li>
                            <li>
                                <a href=""><img src="images/right.png" alt=""/></li>
                            <li><img src="images/right.png" alt=""/></a>
                            </li>
                            <li>
                                <a href=""><img src="images/right.png" alt=""/></li>
                            <li><img src="images/right.png" alt=""/></a>
                            </li>

                        </ul>
                    </div>
                </li>
                <li class="menulist">
                    <a href="">摄像机</a>
                    <div class="menuHiden">
                        <ul class="product">

                            <li>
                                <a href=""><img src="images/right.png" alt=""/></li>
                            <li><img src="images/right.png" alt=""/></a>
                            </li>
                            <li>
                                <a href=""><img src="images/right.png" alt=""/></li>
                            <li><img src="images/right.png" alt=""/></a>
                            </li>
                            <li>
                                <a href=""><img src="images/right.png" alt=""/></li>
                            <li><img src="images/right.png" alt=""/></a>
                            </li>

                        </ul>
                    </div>
                </li>
                <li class="menulist">
                    <a href="">路由器</a>
                    <div class="menuHiden">
                        <ul class="product">

                            <li>
                                <a href=""><img src="images/right.png" alt=""/></li>
                            <li><img src="images/right.png" alt=""/></a>
                            </li>
                            <li>
                                <a href=""><img src="images/right.png" alt=""/></li>
                            <li><img src="images/right.png" alt=""/></a>
                            </li>
                            <li>
                                <a href=""><img src="images/right.png" alt=""/></li>
                            <li><img src="images/right.png" alt=""/></a>
                            </li>

                        </ul>
                    </div>
                </li>
                <li class="menulist">
                    <a href="">儿童机器人</a>
                </li>
                <li class="menulist">
                    <a href="">智品牌</a>
                </li>
                <li class="menulist">
                    <a href="">一元夺宝</a>
                </li>
                <li class="menulist">
                    <a href="">试用</a>
                </li>
                <li class="menulist">
                    <a href="">社区</a>
                </li>
            </ul>

        </div>

    </div>
    <!--导航结束-->
    <div class="clear"></div>

</div>
<!--头部结束-->
<!--中间开始-->
<div id="content">

    <div class="cont">
        <div class="main">
            <div class="content-left">
                <div class="box">
                    <div class="zhezhao"></div>
                    <div class="sekuai"></div>
                    <div class="smallTu"></div>
                    <a href="javascript:;" class="shang">&lt;</a>
                    <div class="list1">

                        <ul>
                            <volist name="goods.medium" id="gs">
                                <li><img src="__ROOT__{$gs}" alt=""></li>
                            </volist>
                        </ul>

                    </div>
                    <a href="javascript:;" class="xia">&gt;</a>

                    <div class="bgTu"></div>
                    <div class="bgTuHide">
                        <ul>
                            <li><img src="./images/800.jpg" alt=""></li>
                            <li><img src="./images/801.jpg" alt=""></li>
                            <li><img src="./images/802.jpg" alt=""></li>
                            <li><img src="./images/800.jpg" alt=""></li>
                            <li><img src="./images/801.jpg" alt=""></li>
                        </ul>

                    </div>
                </div>
            </div>
            <div class="content-right">

                <div class="tit">{$goods['gname']} <span id="specValue"></span></div>
                <div class="description"></div>

                <div class="pirve">￥ <span id="totalPrice">{$goods['shopprice']}</span></div>
                <volist name="specList" id="sl">
                    <div class="category">
                        <h4>{$sl['taname']}</h4>
                        <ul>
                            <volist name="sl.select" id="sls">
                                <li gtid="{$sls['gtid']}">{$sls['gtvalue']}</li>
                            </volist>
                        </ul>
                    </div>
                </volist>
                <div class="num">
                    <h5>数量</h5>
                    <a href="javascript:;" class="num_l">-</a>
                    <input type="text" value="1" id="goodsNum"/>
                    <a href="javascript:;" class="num_r">+</a>
                </div>
                <style>
                    .nobdr .disabled, .nobdr .disabled:hover {
                        background: gray !important;
                    }
                </style>
                <div class="nobdr">
                    <h6><a href="javascript:;" class="disabled">加入购物车</a></h6>
                </div>
                <div class="houdun">
                    <h3>保障</h3>
                    <p><i class="o1"></i>360商城发货&售后</p>
                    <p><i class="o2"></i>满99元包邮</p>
                    <p><i class="o3"></i>7天无理由退货</p>
                    <p><i class="o4"></i>15天免费换货</p>
                </div>
            </div>
        </div>
    </div>
    <div class="desc" id="xijie">
        <div class="desctab">
            <div class="main">
                <ul>
                    <li><a href="#xijie">产品详情</a><span>|</span></li>
                    <li><a href="#guige">规格参数</a><span>|</span></li>
                    <li><a href="#wenti">常见问题</a></li>
                </ul>
            </div>
        </div>


        <div class="con main" id="guige">
            <h1>商品详情</h1>
            <div>
                {$goods['intro']}
            </div>
        </div>
        <div class="con main" id="wenti">
            <h2>售后服务</h2>
            {$goods['service']}

        </div>
    </div>

</div>
</div>
<!--中间结束-->
<!--尾部开始-->
<div class="mod-footer">
    <div class="foot-bannerw">
        <div class="foot-banner clearfix">
            <div class="banner-item">
                <a href="#" target="_blank" data-monitor="home_foot_days7"><i class="icon1">7</i>7天无理由退货</a>
            </div>
            <div class="banner-item">
                <a href="#" target="_blank" data-monitor="home_foot_days15"><i class="icon2">15</i>15天免费换货</a>
            </div>
            <div class="banner-item"><i class="icon3">包</i>满99元包邮</div>
            <div class="banner-item">
                <a href="#" target="_blank" data-monitor="home_foot_moblie"><i class="icon4">服</i>手机特色服务</a>
            </div>
        </div>
    </div>
    <div class="foot-containerw">
        <div class="foot-container clearfix">
            <dl class="foot-con">
                <dt data-monitor="home_foot_freshman">帮助中心</dt>
                <dd data-monitor="home_help_freshman">
                    <a target="_blank" href="#" rel="nofollow">用户注册</a>
                </dd>
                <dd>
                    <a target="_blank" href="#" rel="nofollow">用户登录与密码找回</a>
                </dd>
                <dd>
                    <a target="_blank" href="#" rel="nofollow">购买指南</a>
                </dd>
                <dd>
                    <a target="_blank" href="#" rel="nofollow">支付方式</a>
                </dd>
                <dd>
                    <a target="_blank" href="#" rel="nofollow">配送与说明</a>
                </dd>
            </dl>
            <dl class="foot-con">
                <dt data-monitor="home_foot_help">售后服务</dt>
                <dd data-monitor="home_help_help">
                    <a target="_blank" href="#">7 日无理由退货</a>
                </dd>
                <dd>
                    <a target="_blank" href="#" rel="nofollow">质量问题 15 日内换货</a>
                </dd>
                <dd>
                    <a target="_blank" href="#" rel="nofollow">保修条款</a>
                </dd>
                <dd>
                    <a target="_blank" href="#" rel="nofollow">服务流程</a>
                </dd>
                <dd>
                    <a target="_blank" href="#" rel="nofollow">安迷之家</a>
                </dd>
            </dl>
            <dl class="foot-con">
                <dt data-monitor="home_foot_guide">特色服务</dt>
                <dd data-monitor="home_help_guide">
                    <a target="_blank" href="#" rel="nofollow">F码通道</a>
                </dd>
                <dd>
                    <a target="_blank" href="#" rel="nofollow">免费试用</a>
                </dd>
                <dd>
                    <a target="_blank" href="#" rel="nofollow">360 生态</a>
                </dd>
                <dd>
                    <a target="_blank" href="#" rel="nofollow">一元夺宝</a>
                </dd>
            </dl>
            <dl class="foot-con">
                <dt data-monitor="home_foot_tuiguang">推广合作</dt>
                <dd data-monitor="home_help_try">
                    <a target="_blank" href="#" rel="nofollow">商品入驻</a>
                </dd>
                <dd>
                    <a target="_blank" href="#" rel="nofollow">大客户采购</a>
                </dd>
            </dl>
            <dl class="foot-con">
                <dt data-monitor="home_foot_try">关注360商城</dt>
                <dd data-monitor="home_help_try">
                    <a target="_blank" href="#" rel="nofollow">360商城大事记</a>
                </dd>
            </dl>

        </div>
    </div>
    <div class="footer-copyright">冰雨商城 ©2016-2018 BYCMS工作室版权所有 京ICP备000001号-43</div>
</div>
<!--尾部结束-->

<!--右边底部返回顶部-->
<div class="slidebar" id="slidebar">
    <ul>
        <li class="topback">
            <a href="javascript:;"></a>
        </li>
    </ul>
</div>
<!--右边底部返回顶部结束-->

</body>
<script>
    $(function () {
        var basePrice = parseFloat("<?php echo $goods['shopprice'];?>");
        var specNum = $('.category').length;
        var gid = "{:I('get.gid')}";
        var specData;
        var goodsList = [];//货品相关数据
        $('.category li').on('click', function () {
            var specArr = [];
            specData = [];
            $('.category .zhong').each(function (v, k) {
                specArr.push($(k).attr('gtid'));
                specData.push($(k).html());
            })
            if (specNum == specArr.length) {
                var combine = specArr.join(',');
                $.post("{:u('home/goods/ajaxGetProduct')}", {combine: combine, gid: gid}, function (data) {
                    goodsList = data['goodsList'];

                    if (!data.status) {
                        $('.nobdr a').addClass('disabled');
                        layer.msg('无货', function () {
                        });
                    } else {
                        $('.nobdr a').removeClass('disabled');
                        $('#specValue').html(data.product.gtvalue_str);
                        totalPrice = basePrice + data.product.added_total;
                        $('#totalPrice').html(totalPrice);
                    }
                }, 'json');
            }

        })

        //加入购物车操作
        $('.nobdr a').on('click', function () {
//            console.log(goodsList);
//            return;
            //无货时，无法加入购物车
            if ($(this).is('.disabled')) {
                return;
            }
            //有货，加入购物车操作
            var post = {
                'id': gid, // 商品 ID,
                'glid':goodsList['glid'],
                'glnumber':goodsList['glnumber'],
                'name': "<?php echo $goods['gname']?>",// 商品名称
                'num': $('#goodsNum').val(), // 商品数量
                'price': totalPrice, // 商品价格
                'options': specData,// 其他参数如价格、颜色、可以为数组或字符串
                'pic':"<?php echo $goods['pic']?>"

            };
            $.post("{:u('home/cart/addCart')}",{post:post},function(data){
                if(data){
                    location.href = "{:u('home/cart/lists')}";
                }
            })
        })
    })
</script>

</html>